--- a/CMakeLists.txt	2021-11-17 00:05:26.153515080 -0300
+++ b/CMakeLists.txt	2021-11-17 00:07:09.549884637 -0300
@@ -18,6 +18,8 @@
 #
 
 project(SMPQ)
+file(GLOB_RECURSE CFILES "${CMAKE_SOURCE_DIR}/*.c")
+SET_SOURCE_FILES_PROPERTIES(${CFILES} PROPERTIES LANGUAGE CXX)
 set(VERSION 1.6)
 cmake_minimum_required(VERSION 2.6)
 
@@ -42,11 +44,7 @@
 	endif(NOT STORMLIB_LIBRARY)
 
 	try_compile(CHECK ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/check.c COMPILE_DEFINITIONS -I${STORMLIB_INCLUDE_DIR})
-
-	if(NOT CHECK)
-		message(FATAL_ERROR "Found old StormLib version")
-	endif(NOT CHECK)
-
+	
 	message(STATUS "Found StormLib header: ${STORMLIB_INCLUDE_DIR}/StormLib.h")
 	message(STATUS "Found StormLib library: ${STORMLIB_LIBRARY}")
 
@@ -93,24 +91,16 @@
 if(WITH_CMD)
 
 	add_executable(smpq ${SMPQ_SRCS})
-	target_link_libraries(smpq ${STORMLIB_LIBRARY})
+	find_package(ZLIB REQUIRED)
+	find_package(BZip2 REQUIRED)
+	target_link_libraries(smpq ${STORMLIB_LIBRARY} ${ZLIB_LIBRARY} ${BZIP2_LIBRARIES})
 
 	if(WIN32 AND NOT MSVC)
 		set_target_properties(smpq PROPERTIES LINK_FLAGS -static)
 		target_link_libraries(smpq wininet stdc++)
 	endif(WIN32 AND NOT MSVC)
 
-	install(TARGETS smpq DESTINATION bin)
-
-	if(NOT CMAKE_CROSSCOMPILING)
-
-		add_executable(mangen ${MANGEN_SRCS})
-		add_custom_command(OUTPUT smpq.1 COMMAND mangen > smpq.1 DEPENDS mangen)
-		add_custom_target(man ALL DEPENDS smpq.1)
-
-		install(FILES ${CMAKE_CURRENT_BINARY_DIR}/smpq.1 DESTINATION share/man/man1)
-
-	endif(NOT CMAKE_CROSSCOMPILING)
+	install(TARGETS smpq DESTINATION bin)	
 
 	if(WIN32 AND WITH_NSIS)
 
